#!/usr/bin/env python
#-*- coding: utf-8 -*-

import my_latex as ml

#ml.print_formula(r"""
#\begin{align}
#    m \ddot{x}  &= -sin(\theta) \left( F_2 + F_1 \right)\\
#    m \ddot{z}  &=  cos(\theta) \left( F_2 + F_1 \right) - mg\\
#    J \ddot{\theta} &= l \left( F_2 - F_1 \right)
#\end{align}
#""", "../images/wiki/planar_vtol_newton.png")

ml.print_formula(r"""
\begin{equation}
  \vect{X} = \transp{\begin{pmatrix}x & z & \theta & \dot{x} & \dot{z} & \dot{\theta}\end{pmatrix}}, \quad
  \vect{U} = \transp{\begin{pmatrix}F_1 & F_2\end{pmatrix}} \nonumber
\end{equation}
""", "../images/wiki/planar_vtol_state_space_1.png")

ml.print_formula(r"""
\begin{equation}
  \dot{\vect{X}} = f\left( \vect{X}, \vect{U} \right) \nonumber
\end{equation}
""", "../images/wiki/planar_vtol_state_space_2.png")

ml.print_formula(r"""
\begin{equation}
  \begin{pmatrix}\dot{x}\\\dot{z}\\\dot{\theta}\\\ddot{x}\\\ddot{z}\\\ddot{\theta}\end{pmatrix} = 
  \begin{pmatrix}\dot{x}\\\dot{z}\\\dot{\theta}\\
    -\frac{1}{m}.sin(\theta) \left( F_2 + F_1 \right) \\ 
    \frac{1}{m}.cos(\theta) \left( F_2 + F_1 \right) - g\\
    \frac{l}{J} \left( F_2 - F_1 \right)
  \end{pmatrix} \nonumber
\end{equation}
""", "../images/wiki/planar_vtol_state_space_3.png")
